import request from '@/utils/request';

// 获取评价列表头部
export async function getEvaluationHead(params) {
  const res = await request.get(
    '/api/TechnicianEnd/technician-evaluation/getEvaluationHead',
    { params }
  );
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.data.message));
}

//  获取评价列表

export async function getEvaluationList(params) {
  const res = await request.get(
    '/api/TechnicianEnd/technician-evaluation/getEvaluationList',
    { params }
  );
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.data.message));
}

// 修改接口

export async function evaluationModify(data) {
  const res = await request.put(
    '/api/TechnicianEnd/technician-evaluation',
    data
  );
  console.log(res);
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.data.message));
}
